package argon

import (
	"crypto/sha256"
	"fmt"

	_"golang.org/x/crypto/argon2"
)

// func HasPassWord(password, salt string) (string, error) {
// 	time := uint32(1)
// 	memory := uint32(64 * 1024)
// 	threads := uint8(2)
// 	keyLen := uint32(32)
// 	hasPassWord := argon2.IDKey([]byte(password),[]byte(salt),time,memory,threads,keyLen)
// 	return string(hasPassWord),nil
// }
func HasPassWord(password string) string {
    hasher := sha256.New()
    hasher.Write([]byte(password))
    return fmt.Sprintf("%x", hasher.Sum(nil))
}
// func ComparePassWord(hashedPassword,password, salt string) bool {
// 	time := uint32(1)
// 	memory := uint32(64 * 1024)
// 	threads := uint8(2)
// 	keyLen := uint32(32)
// 	derivedKey := argon2.IDKey([]byte(password),[]byte(salt),time,memory,threads,keyLen)
// 	return subtle.ConstantTimeCompare([]byte(hashedPassword),derivedKey)==1
// }